package c.e.a.c.l;

import java.util.Calendar;
import java.util.TimeZone;
import java.util.concurrent.atomic.AtomicReference;

/* compiled from: UtcDates */
public class t {
    public static AtomicReference<s> a = new AtomicReference();

    public static Calendar a(Calendar calendar) {
        calendar = e(calendar);
        Calendar d = d();
        d.set(calendar.get(1), calendar.get(2), calendar.get(5));
        return d;
    }

    public static TimeZone b() {
        return TimeZone.getTimeZone("UTC");
    }

    public static Calendar c() {
        s sVar = (s) a.get();
        if (sVar == null) {
            sVar = s.c;
        }
        TimeZone timeZone = sVar.b;
        Calendar instance = timeZone == null ? Calendar.getInstance() : Calendar.getInstance(timeZone);
        Long l = sVar.a;
        if (l != null) {
            instance.setTimeInMillis(l.longValue());
        }
        instance.set(11, 0);
        instance.set(12, 0);
        instance.set(13, 0);
        instance.set(14, 0);
        instance.setTimeZone(b());
        return instance;
    }

    public static Calendar d() {
        return e(null);
    }

    public static Calendar e(Calendar calendar) {
        Calendar instance = Calendar.getInstance(b());
        if (calendar == null) {
            instance.clear();
        } else {
            instance.setTimeInMillis(calendar.getTimeInMillis());
        }
        return instance;
    }
}
